﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SerialPortHelper
{
    public partial class Form2 : Form
    {

        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }


        /// <summary>
        /// 注意这个函数的签名 和 返回值 必须和委托的一致
        /// </summary>
        /// <param name="bytes"></param>
        public void ReceiveData(byte[] bytes)
        {
            richTextReceive.AppendText(Encoding.GetEncoding("gb2312").GetString(bytes).Replace("\0", "\\0"));
        }
    }
}
